import request from '@/utils/request'
export interface navWapList {
  code: number
  data: { checkNavType: number; navList: navWapData[] }
}

export interface navWapData {
  id: number | string
  picUrl: string
  mainTitle: string
  viceTitle: string
  onlineType?: boolean
  columnUrl?: string
  vaildStarTime?: number
  vailEndTime?: number
  rank?: number
}

export interface puBu {
  code: number
  data: {
    result: recAuto[]
    hasMore: boolean
  }
}
export interface recAuto {
  look: {
    appBanHeight: number
    appBanWidth: number
    avatar: string
    content: string
    lookPics: video[]
    nickmame: string
    picUrl: string
    readCount: number
    schemeUrl: string
    title: string
    topicId: string
  }
  topics: recAutos[]
}

export interface recAutos {
  appBanHeight?: number
  appBanWidth?: number
  appStatus?: string
  avatar?: string
  buyNow?: string | null
  categoryIds?: string
  content?: string | null
  duration?: number
  hasLookCollects?: boolean
  hasVideo?: boolean
  height?: number
  itemIdList?: number[]
  itemList?: null
  layoutType?: number
  lookList?: null
  newAppBanner?: string
  newAppBannerHeight?: number
  newAppBannerWidth?: number
  nickname?: string
  pcBannerSize?: string | number | null
  picUrl?: string
  pubType?: number
  readCount?: number
  schemeUrl?: string
  size?: number
  status?: string
  statusValid?: true
  style?: number
  subTitle?: string
  timeStamp?: number
  title?: string
  topType?: false
  topicExtend?: string | null
  topicId?: string
  type?: number
  videoUrl?: string | null
  wapStatus?: string
  width?: number
}
export interface video {
  duration: number
  height: number
  isVideo: true
  picUrl: string
  size: number
  tagInfo: string
  videoUrl: string
  width: number
}
export default {
  getNavWap() {
    return request.get<any, navWapList>('/topic/v1/know/navWap.json')
  },
  getRecAuto(page: number = 1, size: number = 2) {
    return request.get<any, puBu>(`/topic/v1/find/recAuto.json?page=${page}&size=${size}`)
  }
}
